<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="he1">
        <div class="he2">

        </div>
    </div>
</body>
</html><script>

</script>
<style>
    .he1{
       width: 100px;
       height: 100px;
       border: 2px solid red ; 
       display: flex;
       justify-content: center;
       align-items: center;
    }
    .he2{
        width: 40px;
        height: 40px;
        background-color: yellow;
    }

</style>